package org.springblade.modules.admin.vo.sugar;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @Description
 * @Author ysq
 * @Date 2022/10/27
 **/
@Data
public class MaintainTypeDataVO {

	@ApiModelProperty(value = "类型 0-未执行，1-未完成，2-已完成，3-及时，4-预期")
	private Integer type;

	@ApiModelProperty(value = "工单数")
	private Long orderTotal;

	@ApiModelProperty(value = "占比")
	private String percentage;

	public String getPercentage() {
		if (this.percentage == null) {
			this.percentage = "0%";
		}
		return percentage;
	}

	public void setPercentage(BigDecimal percentage) {
		this.percentage = String.format("%s%%",percentage.multiply(new BigDecimal(100)).setScale(1).toString());
	}
}
